import Vue from 'vue'
import Vuex from 'vuex'
import request from "../utils/request"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
      list:[]
  },
  mutations: {
    SetState(state,payload){
      state[payload.key]=payload.value
    }
  },
  actions: {
    getlist({commit}){
      let res = request.get('http://127.0.0.1:7001/getList')
      commit('SetState',{key:"list",value:res.data.data})
    }
  },
  modules: {
  }
})
